package mvp.com.register.view.myview;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;

import mvp.com.register.utils.LogUtils;

/**
 * 自定义View的基类
 * Created by Administrator on 2016/9/17 0017.
 */
public abstract class MyCustomView extends LinearLayout {

    private static final String TAG = "MyCustomView";

    public Context context;
    public LayoutInflater inflater;

    public MyCustomView(Context context) {
        super(context);
        init(context);
        initView(inflater);
    }

    public MyCustomView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);
        initView(inflater);
        setAttrs(attrs);
    }

    public MyCustomView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
        initView(inflater);
        setAttrs(attrs);

    }

    public void init(Context context) {
        LogUtils.i(TAG, "initView");
        this.context = context;


    }

    public abstract void setAttrs(AttributeSet attrs);

    public abstract void initView(LayoutInflater inflater);
}
